home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / dev / moni / systemviewer.lha / SysInterrupt.c < prev    next >
C/C++ Source or Header  |  2001-04-25  |  17KB  |  706 lines

  1. /****h* SysViewer/SysInterrupt.c [1.1] *********************************
  2. *
  3. * NAME
  4. *    SysInterrupt.c
  5. *
  6. * DESCRIPTION
  7. *    Display the interrupts known in ExecBase->IntVects[].
  8. ************************************************************************
  9. *
  10. */
  11.  
  12. #include <string.h>
  13.  
  14. #include <exec/types.h>
  15. #include <exec/execbase.h>
  16.  
  17. #include <AmigaDOSErrs.h>
  18.  
  19. #include <intuition/intuition.h>
  20. #include <intuition/classes.h>
  21. #include <intuition/classusr.h>
  22. #include <intuition/gadgetclass.h>
  23.  
  24. #include <libraries/gadtools.h>
  25.  
  26. #include <graphics/displayinfo.h>
  27. #include <graphics/gfxbase.h>
  28.  
  29. #include <clib/exec_protos.h>
  30. #include <clib/intuition_protos.h>
  31. #include <clib/gadtools_protos.h>
  32. #include <clib/graphics_protos.h>
  33. #include <clib/utility_protos.h>
  34. #include <clib/diskfont_protos.h>
  35.  
  36. #include "CPGM:GlobalObjects/CommonFuncs.h"
  37.  
  38. #include "SysLists.h"
  39.  
  40. #define ILV       0
  41. #define Update    1
  42. #define Remove    2
  43. #define Priority  3
  44. #define Cancel    4
  45. #define SelectTxt 5
  46.  
  47. #define SI_CNT    6
  48.  
  49. #define INTLVGAD    SIGadgets[ ILV ]
  50. #define REMOVEGAD   SIGadgets[ Remove ]
  51. #define PRIORITYGAD SIGadgets[ Priority ]
  52. #define TEXTGAD     SIGadgets[ SelectTxt ]
  53.  
  54. IMPORT struct ExecBase *SysBase;
  55.  
  56. // --------------------------------------------------------------------
  57.  
  58. PRIVATE char ver[] = "\0$VER: SysInterrupts 1.1 (25-Apr-2001) by J.T. Steichen\0";
  59.  
  60. PRIVATE struct TextFont     *SIFont  = NULL;
  61. PRIVATE struct Window       *SIWnd   = NULL;
  62. PRIVATE struct Gadget       *SIGList = NULL;
  63. PRIVATE struct IntuiMessage  SIMsg;
  64. PRIVATE struct Gadget       *SIGadgets[ SI_CNT ];
  65.  
  66. PRIVATE UWORD  SILeft   = 0;
  67. PRIVATE UWORD  SITop    = 16;
  68. PRIVATE UWORD  SIWidth  = 632;
  69. PRIVATE UWORD  SIHeight = 320;
  70. PRIVATE UBYTE *SIWdt    = (UBYTE *) "System Interrupts Info:";
  71.  
  72. PRIVATE char ttl[] = "Address  Data     Code     Pri Type      State  Nr IntrName Name";
  73. PRIVATE char fmt[] = "%08LX %08LX %08LX %3d %9.9s %-6.6s %2d %-8.8s %-18.18s";
  74.  
  75. PRIVATE UBYTE tb[256] = "", *Title = &tb[0];
  76.  
  77. // --------------------------------------------------------------------
  78.  
  79. #define MAXNODES   64
  80. #define NODELENGTH 80
  81.  
  82. PRIVATE struct Node ILVNodes[ MAXNODES ] = { 0, };
  83.  
  84. PRIVATE struct List ILVList              = { 0, };
  85.  
  86. PRIVATE UBYTE       NodeStrs[ MAXNODES * NODELENGTH ] = "";
  87.  
  88. PRIVATE struct ListViewMem lvm = { 0, };
  89.  
  90. // --------------------------------------------------------------------
  91.  
  92. PRIVATE struct IntuiText SIIText[ 1 ] = {
  93.  
  94.    2, 0, JAM1, 262, 10,  NULL, (UBYTE *) "AJunk:",    NULL
  95. };
  96.  
  97. PRIVATE UWORD SIGTypes[] = {
  98.  
  99.    LISTVIEW_KIND, BUTTON_KIND, BUTTON_KIND,
  100.    BUTTON_KIND,   BUTTON_KIND, TEXT_KIND
  101. };
  102.  
  103. PRIVATE int ILVClicked(      int whichitem );
  104. PRIVATE int UpdateClicked(   int dummy     );
  105. PRIVATE int RemoveClicked(   int dummy     );
  106. PRIVATE int PriorityClicked( int dummy     );
  107. PRIVATE int CancelClicked(   int dummy     );
  108.  
  109. PRIVATE struct NewGadget SINGad[] = {
  110.  
  111.      2,  17, 627, 272,                 NULL, NULL, ILV, 0, 
  112.    NULL, (APTR) ILVClicked,
  113.    
  114.      4, 301,  71,  17, (UBYTE *) "_Update",  NULL, Update, PLACETEXT_IN, 
  115.    NULL, (APTR) UpdateClicked,
  116.    
  117.    317, 301,  72,  17, (UBYTE *) "Remove",   NULL, Remove, PLACETEXT_IN, 
  118.    NULL, (APTR) RemoveClicked,
  119.    
  120.    396, 301,  72,  17, (UBYTE *) "Priority", NULL, Priority, PLACETEXT_IN,
  121.    NULL, (APTR) PriorityClicked,
  122.    
  123.    554, 301,  72,  17, (UBYTE *) "_Cancel",  NULL, Cancel, PLACETEXT_IN,
  124.    NULL, (APTR) CancelClicked,
  125.  
  126.      2, 283, 627,  16,                 NULL, NULL, SelectTxt, NULL, 
  127.    NULL, NULL  
  128. };
  129.  
  130. PRIVATE ULONG SIGTags[] = {
  131.  
  132.    GTLV_Selected, 0, GTLV_ShowSelected, NULL, LAYOUTA_Spacing, 2, TAG_DONE,
  133.  
  134.    GT_Underscore, '_', TAG_DONE,
  135.  
  136.    GA_Disabled,  TRUE, TAG_DONE,
  137.    GA_Disabled,  TRUE, TAG_DONE,
  138.  
  139.    GT_Underscore, '_', TAG_DONE,
  140.    
  141.    GTTX_Border,  TRUE, TAG_DONE
  142. };
  143.  
  144. // --------------------------------------------------------------------
  145.  
  146. PRIVATE char mvn[80] = "";
  147.  
  148. PRIVATE char *MakeValidName( char *name, int size )
  149. {
  150.    int len = strlen( name ), i = 0;
  151.  
  152.    if (len > 80)
  153.       len = 79;
  154.       
  155.    if (len < 1)
  156.       {
  157.       strncpy( mvn, " ", size );
  158.  
  159.       mvn[ size + 1 ] = '\0';
  160.  
  161.       return( &mvn[0] );
  162.       }
  163.  
  164.    while (i < len)
  165.       {
  166.       if ((*(name + i) > 0x7E) || (*(name + i) < 0x20))
  167.          mvn[i] = ' ';
  168.       else
  169.          mvn[i] = *(name + i);
  170.           
  171.       i++;
  172.       }   
  173.  
  174.    mvn[i] = '\0';
  175.    
  176.    return( &mvn[0] );
  177. }
  178.  
  179.  
  180. PRIVATE ULONG IntrAddress = 0L;
  181. PRIVATE char  itype[12]   = "INTERRUPT";
  182.  
  183. PRIVATE char *GetIntrType( struct Node *iptr )
  184. {
  185.    switch (iptr->ln_Type)
  186.       {
  187.       case NT_INTERRUPT:  
  188.          strcpy( itype, "INTERRUPT" );
  189.          break;
  190.       
  191.       case NT_SOFTINT:
  192.          strcpy( itype, "SOFTINTRT" );
  193.          break;
  194.       
  195.       default:
  196.          strcpy( itype, "UNKNOWN  " );
  197.          break; 
  198.       }
  199.  
  200.    return( &itype[0] );
  201. }
  202.  
  203. PRIVATE char *IntrName[] = {
  204.  
  205.    "XMit Emt", "Disk Blk", "Soft Int", "I/O Port",
  206.    "Co-Proc ", "VertBeam", "Blitter ", "Aud Ch.1",
  207.    "Aud Ch.2", "Aud Ch.3", "Aud Ch.4", "ReadFull",   
  208.    "DiskSync", "External", "Mstr Enb", "NMI     "
  209. };
  210.  
  211.  
  212. PRIVATE char IntrPri[] = { 1,1,1,2,3,3,3,4,4,4,4,5,5,6,6,7 };
  213.  
  214. PRIVATE char NName[32] = "";
  215.  
  216. PRIVATE char *GetNodeName( struct Node *node )
  217. {
  218.    if (node == NULL)
  219.       strcpy( NName, "* NULL *" );
  220.  
  221.    if (node->ln_Name == NULL) 
  222.       strcpy( NName, "NO Name!" );
  223.    else 
  224.       strncpy( NName, MakeValidName( node->ln_Name, 31 ), 31 );
  225.  
  226.    return( &NName[0] );
  227. }
  228.  
  229.  
  230. PRIVATE int GetNodePri( struct Node *node )
  231. {
  232.    if (node == NULL) 
  233.       return( 0 );
  234.  
  235.    return( node->ln_Pri );
  236. }
  237.  
  238. PRIVATE int MakeIntStrings( void )
  239. {
  240.    struct Custom    *custom = (struct Custom *) 0xDFF000;
  241.    // Used only to tell if an Interrupt is enabled or not.    
  242.    
  243.    struct IntVector *iv     = NULL;
  244.    APTR              sc     = NULL;
  245.    char             *iname  = NULL;
  246.    int               i, j, rval = 0, dummy = 0;
  247.  
  248.    Forbid();
  249.       
  250.       iv = &SysBase->IntVects[0];
  251.       sc = (APTR) SysBase->IntVects[3].iv_Code;
  252.          
  253.    Permit(); // Move this later!
  254.    
  255.    for (i = 0, j = 0; i < 16; i++, iv++)
  256.       {
  257.       if ((iv != NULL) && (iv->iv_Code != NULL))
  258.          {
  259.          if (iv->iv_Code == sc) // Software Interrupt list:
  260.             {
  261.             struct List      *slist = (struct List      *) iv->iv_Data;
  262.             struct Interrupt *s     = (struct Interrupt *) slist->lh_Head;
  263.  
  264.             if (slist->lh_Head == slist->lh_Tail) // Empty list?
  265.                {
  266.                goto SkipSoftInts; // Probably will never get here.
  267.                }
  268.  
  269.             while ((s != NULL) && (j <= MAXNODES))
  270.                {
  271.                iname = GetNodeName( &(s->is_Node) );
  272.  
  273.                //"Address Data Code Pri Type State Nr IntrName Name"
  274.                sprintf( &NodeStrs[ NODELENGTH * j++ ], fmt,
  275.                         &s->is_Node,
  276.                         s->is_Data,
  277.                         s->is_Code,
  278.                         GetNodePri(  &(s->is_Node) ),
  279.                         "SOFTINTRT",
  280.                         (custom->intenar & (1 << i)) ? "Enb'd" : "Dis'd",
  281.                         IntrPri[i],
  282.                         IntrName[i],
  283.                         iname
  284.                       );
  285.  
  286.                rval++; 
  287.                
  288.                s = (struct Interrupt *) s->is_Node.ln_Succ;
  289.                }
  290.             }
  291.          else
  292.             {
  293.             iname = GetNodeName( iv->iv_Node );
  294.  
  295.             //"Address Data Code Pri Type State Nr IntrName Name"
  296.             sprintf( &NodeStrs[ NODELENGTH * j++ ], fmt,
  297.                      iv->iv_Node,
  298.                      iv->iv_Data,
  299.                      iv->iv_Code,
  300.                      GetNodePri(  iv->iv_Node ),
  301.                      GetIntrType( iv->iv_Node ),
  302.                      (custom->intenar & (1 << i)) ? "Enb'd" : "Dis'd",
  303.                      IntrPri[i],
  304.                      IntrName[i],
  305.                      iname
  306.                    );
  307.  
  308.             rval++;
  309.             } 
  310.          }
  311.  
  312. SkipSoftInts:
  313.       dummy = 0; // Hopefully, the optimizer will kill this.
  314.  
  315.       }
  316.  
  317.    return( rval );
  318. }
  319.  
  320. PRIVATE int MakeIntrList( void )
  321. {
  322.    int i = 0;
  323.    
  324.    HideListFromView( INTLVGAD, SIWnd );
  325.    
  326.    i = MakeIntStrings();
  327.  
  328.    GT_SetGadgetAttrs( INTLVGAD, SIWnd, NULL,
  329.                       GTLV_Labels,       &ILVList,
  330.                       GTLV_Selected,     1,
  331.                       TAG_END
  332.                     );
  333.  
  334.    sprintf( Title, "%s  (# interrupts = %d):", SIWdt, i );
  335.  
  336.    DisplayTitle( SIWnd, Title );
  337.  
  338.    return( i );
  339. }
  340.  
  341. PRIVATE int ILVClicked( int whichitem )
  342. {
  343. /*
  344.    if (whichitem == 0)
  345.       {
  346.       GT_SetGadgetAttrs( REMOVEGAD, SIWnd, NULL, 
  347.                          GA_Disabled, TRUE, TAG_DONE
  348.                        );
  349.  
  350.       GT_SetGadgetAttrs( PRIORITYGAD, SIWnd, NULL, 
  351.                          GA_Disabled, TRUE, TAG_DONE
  352.                        );
  353.  
  354.       strncpy( Title, SIWdt, 80 );
  355.       DisplayTitle( SIWnd, Title );
  356.       }
  357.    else
  358.       {
  359. */
  360.       char bf[12];
  361.       
  362.       GT_SetGadgetAttrs( REMOVEGAD, SIWnd, NULL, 
  363.                          GA_Disabled, FALSE, TAG_DONE
  364.                        );
  365.  
  366.       GT_SetGadgetAttrs( PRIORITYGAD, SIWnd, NULL, 
  367.                          GA_Disabled, FALSE, TAG_DONE
  368.                        );
  369.       
  370.       strncpy( &bf[0], &NodeStrs[ whichitem * NODELENGTH ], 11 );
  371.       
  372.       (void) stch_l( &bf[0], (long *) &IntrAddress );
  373.  
  374.       sprintf( Title, "%s  You Selected:  0x%08LX", SIWdt, IntrAddress );
  375.  
  376.       DisplayTitle( SIWnd, Title );
  377.  
  378.       GT_SetGadgetAttrs( TEXTGAD, SIWnd, NULL,
  379.                          GTTX_Text, &NodeStrs[ whichitem * NODELENGTH ], 
  380.                          TAG_END
  381.                        );
  382. //      }
  383.  
  384.    return( TRUE );
  385. }
  386.  
  387. PRIVATE int UpdateClicked( int dummy )
  388. {
  389.    int i;
  390.  
  391.    strcpy( Title, "Updating list..." );
  392.  
  393.    DisplayTitle( SIWnd, Title );
  394.    
  395.    for (i = 0; i < MAXNODES; i++)         // 0 = No title inside ListView
  396.        NodeStrs[ i * NODELENGTH ] = '\0'; // Kill old ListView strings.
  397.  
  398.    (void) MakeIntrList();    // Remake ListView strings.
  399.  
  400.    GT_SetGadgetAttrs( TEXTGAD, SIWnd, NULL,
  401.                       GTTX_Text, (STRPTR) NULL, TAG_END
  402.                     );
  403.  
  404.    GT_SetGadgetAttrs( INTLVGAD, SIWnd, NULL,
  405.                       GTLV_Selected, 0, TAG_END
  406.                     );
  407.  
  408.    GT_RefreshWindow( SIWnd, NULL );
  409.  
  410.    return( (int) TRUE );
  411. }
  412.  
  413. PRIVATE int RemoveClicked( int dummy )
  414. {
  415.    sprintf( ErrMsg, "You MUST be off your medication!\n"
  416.                     "This function NOT available!" 
  417.           );
  418.  
  419.    UserInfo( ErrMsg, "User Information:" );
  420.       
  421.    strncpy( Title, SIWdt, 80 );
  422.    DisplayTitle( SIWnd, Title ); // Just in case.
  423.  
  424.    return( TRUE );
  425. }
  426.  
  427. PRIVATE int PriorityClicked( int dummy )
  428. {
  429.    sprintf( ErrMsg, "NOT implemented yet!" );
  430.  
  431.    UserInfo( ErrMsg, "User Information:" );
  432.  
  433.    strncpy( Title, SIWdt, 80 );
  434.    DisplayTitle( SIWnd, Title ); // Just in case.
  435.  
  436.    return( TRUE );
  437. }
  438.  
  439. PRIVATE void CloseSIWindow( void )
  440. {
  441.    if (SIWnd != NULL) 
  442.       {
  443.       CloseWindow( SIWnd );
  444.       SIWnd = NULL;
  445.       }
  446.  
  447.    if (SIGList != NULL) 
  448.       {
  449.       FreeGadgets( SIGList );
  450.       SIGList = NULL;
  451.       }
  452.  
  453.    if (SIFont != NULL) 
  454.       {
  455.       CloseFont( SIFont );
  456.       SIFont = NULL;
  457.       }
  458.  
  459.    return;
  460. }
  461.  
  462. PRIVATE int SICloseWindow( void )
  463. {
  464.    CloseSIWindow();
  465.    return( FALSE );
  466. }
  467.  
  468. PRIVATE int CancelClicked( int dummy )
  469. {
  470.    return( SICloseWindow() );
  471. }
  472.  
  473. // ------------------------------------------------------------------
  474.  
  475. PRIVATE void SIRender( void )
  476. {
  477.    struct IntuiText it;
  478.  
  479.    ComputeFont( Scr, Font, &CFont, SIWidth, SIHeight );
  480.  
  481.    CopyMem( (char *) &SIIText[0], (char *) &it, 
  482.             (long) sizeof( struct IntuiText )
  483.           );
  484.  
  485.    it.IText     = (UBYTE *) &ttl[0];
  486.    
  487.    it.ITextFont = Font;
  488.  
  489.    it.LeftEdge  = CFont.OffX + ComputeX( CFont.FontX, it.LeftEdge ) 
  490.                              - (IntuiTextLength( &it ) >> 1);
  491.  
  492.    it.TopEdge   = CFont.OffY + ComputeY( CFont.FontY, it.TopEdge ) 
  493.                              - (Font->ta_YSize >> 1);
  494.  
  495.    PrintIText( SIWnd->RPort, &it, 0, 0 );
  496.  
  497.    return;
  498. }
  499.  
  500. PRIVATE int OpenSIWindow( void )
  501. {
  502.    struct NewGadget    ng;
  503.    struct Gadget    *g;
  504.    UWORD        lc, tc;
  505.    UWORD        wleft = SILeft, wtop = SITop, ww, wh;
  506.  
  507.    ComputeFont( Scr, Font, &CFont, SIWidth, SIHeight );
  508.  
  509.    ww = ComputeX( CFont.FontX, SIWidth );
  510.    wh = ComputeY( CFont.FontY, SIHeight );
  511.  
  512.    if (( wleft + ww + CFont.OffX + Scr->WBorRight ) > Scr->Width ) 
  513.       wleft = Scr->Width - ww;
  514.    
  515.    if (( wtop + wh + CFont.OffY + Scr->WBorBottom ) > Scr->Height ) 
  516.       wtop = Scr->Height - wh;
  517.  
  518.    if ((SIFont = OpenDiskFont( Font )) == NULL)
  519.        return( -5 );
  520.  
  521.    if ((g = CreateContext( &SIGList )) == NULL)
  522.        return( -1 );
  523.  
  524.    for (lc = 0, tc = 0; lc < SI_CNT; lc++) 
  525.       {
  526.       CopyMem( (char *) &SINGad[ lc ], (char *) &ng, 
  527.                (long) sizeof( struct NewGadget )
  528.              );
  529.  
  530.       ng.ng_VisualInfo = VisualInfo;
  531.       ng.ng_TextAttr   = Font;
  532.  
  533.       ng.ng_LeftEdge   = CFont.OffX + ComputeX( CFont.FontX, 
  534.                                                 ng.ng_LeftEdge
  535.                                               );
  536.  
  537.       ng.ng_TopEdge    = CFont.OffY + ComputeY( CFont.FontY, 
  538.                                                 ng.ng_TopEdge
  539.                                               );
  540.  
  541.       ng.ng_Width      = ComputeX( CFont.FontX, ng.ng_Width );
  542.       ng.ng_Height     = ComputeY( CFont.FontY, ng.ng_Height);
  543.  
  544.       SIGadgets[ lc ] = g 
  545.                       = CreateGadgetA( (ULONG) SIGTypes[ lc ], 
  546.                                        g, 
  547.                                        &ng, 
  548.                                        (struct TagItem *) &SIGTags[ tc ]
  549.                                      );
  550.  
  551.       while (SIGTags[ tc ] != TAG_DONE) 
  552.          tc += 2;
  553.  
  554.       tc++;
  555.  
  556.       if (g == NULL)
  557.          return( -2 );
  558.       }
  559.  
  560.    if ((SIWnd = OpenWindowTags( NULL,
  561.  
  562.                   WA_Left,    wleft,
  563.                   WA_Top,     wtop,
  564.                   WA_Width,   ww + CFont.OffX + Scr->WBorRight,
  565.                   WA_Height,  wh + CFont.OffY + Scr->WBorBottom,
  566.       
  567.                   WA_IDCMP,   LISTVIEWIDCMP | BUTTONIDCMP 
  568.                     | IDCMP_CLOSEWINDOW | IDCMP_REFRESHWINDOW 
  569.                     | IDCMP_VANILLAKEY,
  570.       
  571.                   WA_Flags,   WFLG_DRAGBAR | WFLG_DEPTHGADGET 
  572.                     | WFLG_CLOSEGADGET | WFLG_SMART_REFRESH
  573.                     | WFLG_ACTIVATE | WFLG_RMBTRAP,
  574.       
  575.                   WA_Gadgets, SIGList,
  576.                   WA_Title,   SIWdt,
  577.                   TAG_DONE )
  578.       ) == NULL)
  579.       return( -4 );
  580.  
  581.    GT_RefreshWindow( SIWnd, NULL );
  582.  
  583.    SIRender();
  584.    
  585.    return( 0 );
  586. }
  587.  
  588. PRIVATE int SIVanillaKey( int whichkey )
  589. {
  590.    int rval = TRUE;
  591.    
  592.    switch (whichkey)
  593.       {
  594.       case 'u':
  595.       case 'U':
  596.          rval = UpdateClicked( 0 );
  597.          break;   
  598.       
  599.       case 'c':
  600.       case 'C':
  601.       case 'q':
  602.       case 'Q':
  603.          rval = CancelClicked( 0 );
  604.          break;
  605.       }
  606.       
  607.    return( rval );
  608. }
  609.  
  610. PRIVATE int HandleSIIDCMP( void )
  611. {
  612.    struct IntuiMessage *m;
  613.    int                (*func)( int );
  614.    BOOL                 running = TRUE;
  615.  
  616.    while (running == TRUE)
  617.       {
  618.       if ((m = GT_GetIMsg( SIWnd->UserPort )) == NULL) 
  619.          {
  620.          (void) Wait( 1L << SIWnd->UserPort->mp_SigBit );
  621.          continue;
  622.          }
  623.  
  624.       CopyMem( (char *) m, (char *) &SIMsg, 
  625.                (long) sizeof( struct IntuiMessage )
  626.              );
  627.  
  628.       GT_ReplyIMsg( m );
  629.  
  630.       switch (SIMsg.Class) 
  631.          {
  632.          case IDCMP_REFRESHWINDOW:
  633.             GT_BeginRefresh( SIWnd );
  634.             GT_EndRefresh( SIWnd, TRUE );
  635.             break;
  636.  
  637.          case IDCMP_CLOSEWINDOW:
  638.             running = SICloseWindow();
  639.             break;
  640.  
  641.          case IDCMP_VANILLAKEY:
  642.             running = SIVanillaKey( SIMsg.Code );
  643.             break;
  644.             
  645.          case IDCMP_GADGETUP:
  646.          case IDCMP_GADGETDOWN:
  647.             func = (void *) ((struct Gadget *) SIMsg.IAddress)->UserData;
  648.             
  649.             if (func != NULL)
  650.                running = func( SIMsg.Code );
  651.  
  652.             break;
  653.          }
  654.       }
  655.  
  656.    return( running );
  657. }
  658.  
  659. // ------------------------------------------------------------------
  660.  
  661. PUBLIC int main( void )
  662. {
  663.    int i = 0;
  664.    
  665.    if (SetupSystemList( &OpenSIWindow ) < 0)
  666.       {
  667.       fprintf( stderr, "Couldn't open a System ListViewer!\n" );
  668.       return( RETURN_FAIL );
  669.       }
  670.    
  671.    SetNotifyWindow( SIWnd );
  672.  
  673.    DisplayTitle( SIWnd, "Making Interrupt List..." );
  674.  
  675.    lvm.lvm_NodeStrs   = &NodeStrs[0];
  676.    lvm.lvm_Nodes      = &ILVNodes[0];
  677.    lvm.lvm_NumItems   = MAXNODES;
  678.    lvm.lvm_NodeLength = NODELENGTH;
  679.  
  680.    SetupList( &ILVList, &lvm );   
  681.  
  682.    strcpy( ILVNodes[0].ln_Name, ttl );
  683.  
  684.    (void) MakeIntrList(); // Make the list.
  685.  
  686.    ModifyListView( INTLVGAD, SIWnd, &ILVList, NULL );
  687.  
  688.    GT_SetGadgetAttrs( TEXTGAD, SIWnd, NULL,
  689.                       GTTX_Text, (STRPTR) NULL, TAG_END
  690.                     );
  691.  
  692.    DisplayTitle( SIWnd, SIWdt );
  693.  
  694.    GT_RefreshWindow( SIWnd, NULL );
  695.  
  696.    (void) HandleSIIDCMP();
  697.  
  698.    CloseSIWindow();         // Just in case.   
  699.  
  700.    ShutdownSystemList();
  701.  
  702.    return( RETURN_OK );
  703. }
  704.  
  705. /* ------------------ END of SysInterrupt.c file! ----------------- */
  706.